<?php

namespace App\Http\Controllers;

use App\Models\Configs;
use App\Models\Domain;
use Illuminate\Foundation\Auth\Access\AuthorizesRequests;
use Illuminate\Foundation\Bus\DispatchesJobs;
use Illuminate\Foundation\Validation\ValidatesRequests;
use Illuminate\Routing\Controller as BaseController;

class Controller extends BaseController
{
    use AuthorizesRequests, DispatchesJobs, ValidatesRequests;
    public function getBottomConfig(): array
    {
        $config = Configs::query()->whereIn('key', ['address', 'phone', 'work_date', 'qrcode', 'contact_1', 'contact_2'])->get()->keyBy('key')->toArray();
        $domain = Domain::query()->limit('6')->get()->toArray();
        return [
            'config' => $config,
            'domain' => $domain
        ];
    }
}
